package com.futvan.z.shop.sticket;

import org.springframework.stereotype.Service;
import com.futvan.z.framework.core.SuperService;

import java.util.List;

@Service
public class SticketService extends SuperService {


    /**
     * 根据zid查询礼券信息
     *
     * @param zid
     * @return
     */
    public s_ticket getTicketInfo(String zid) {
        s_ticket ticket = sqlSession.selectOne("s_ticket_select_sql", "select * from s_ticket where number = '" + zid + "'");
        if (ticket != null) {
            return ticket;
        }
        return null;
    }


    /**
     * 根据pid查询礼券产品明细
     *
     * @return
     */
    public List<s_ticket_product> getTicketProductList(String pid) {
        List<s_ticket_product> list = sqlSession.selectList("s_ticket_product_select_pid", pid);
        if (list != null && list.size() > 0) {
            return list;
        }
        return null;
    }
}
